<!--
 * @Date: 2022-03-29 14:09:15
 * @LastEditors: 春贰
 * @gitee: https://gitee.com/chun22222222
 * @github: https://github.com/chun222
 * @Desc: 
 * @LastEditTime: 2022-03-31 10:40:32
 * @FilePath: \web\src\component\file\src\index.vue
-->
<template>
  <div :class="['go2-file']">
        <div :class="{ 'selected': selected }">
           <go2-icon v-if="type=='dir'" class="icon icon_dir" type="FolderFilled"></go2-icon> 
          <go2-icon v-else-if="isImg(type)" class="icon icon_img" type="PictureFilled"></go2-icon> 
          <go2-icon v-else class="icon icon_default" type="FileFilled"></go2-icon> 
          <p>{{name}}</p>
        </div>
         
    
  </div>
</template>
<script>
import "./index.less";
import { defineComponent, reactive, ref } from "vue";  
import { useI18n  } from "vue-i18n";
import { isImg } from "@/core/tools/common";
export default defineComponent({
  name: "go2-file",
  props: {
    
    name: {
      type: String,
      default: ""
    },
    type: {
      type: String,
      default: "dir"
    },
    selected: {
      type:Boolean,
      default: false
    }
  },  
  setup(props, {emit}) {
    
    const hidden = ref(true);
    const more = ref(false);
    const { t } = useI18n();
    const formState = reactive({ 
    })
    const formRules = reactive({})

   
  

    return {
        t,
        isImg
 
    }
  }
});
</script>

 